<template>
  <el-config-provider :locale="locale">
    <RouterView/>
  </el-config-provider>
</template>
<script lang="ts" setup>
import {computed} from 'vue';
import {RouterView} from 'vue-router';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
import en from 'element-plus/dist/locale/en.mjs';
import useLocale from '@/hooks/use-locale';
import {LOCALE_EN, LOCALE_ZH_CN} from './locale';
import {useLayoutStore} from '@/store';

const {localeValue} = useLocale();

const locale = computed(() => {
  switch (localeValue.value) {
    case LOCALE_ZH_CN:
      return zhCn;
    case LOCALE_EN:
      return en;
    default:
      return zhCn;
  }
});

const layoutStore = useLayoutStore();
const layoutSize = computed(() => layoutStore.layoutSize);
</script>
<style lang="scss" scoped>

</style>
